package Dao;

import Dao.impl.CalImpl;

import java.lang.reflect.Proxy;

public class Demo {
    public static void main(String[] args) {
        Cal cal = new CalImpl();
        MyInvocationHandler myInvocationHandler = new MyInvocationHandler();
        myInvocationHandler.bind(cal);

        Cal proxyCal = (Cal) Proxy.newProxyInstance(Demo.class.getClassLoader(),cal.getClass().getInterfaces(),myInvocationHandler);

        proxyCal.add(10,3);
        proxyCal.sub(10,3);
        proxyCal.mul(10,3);
        proxyCal.div(10,3);

    }
}
